
from appium import webdriver
from time import sleep
import logging.config
import os
logging.config.fileConfig(r'../config/log_conf.ini')
def insert_img(driver, name):
    dir_name = os.path.dirname(__file__)
    logging.info(dir_name)
    up_dir_name = os.path.dirname(dir_name)
    logging.info(up_dir_name)
    img_name = rf'{up_dir_name}\reports\screenshots\{name}.png'
    logging.info(img_name)
    driver.get_screenshot_as_file(img_name)


if __name__ == '__main__':
    import sys
    sys.path.append(r'..')
    from common.desired_caps import desired_caps
    driver=desired_caps()
    insert_img(driver,'phonetest')

